<?php
$this->breadcrumbs=array(
	'Coffee Shops'=>array('index'),
	'Export File',
);

/*
Yii::app()->clientScript->registerScript('element-control', "

$('#CoffeeShopExportSearchForm_claimed').click(function(){
	if($(this).attr('checked')=='checked'){
		$('#CoffeeShopExportSearchForm_ownerName').removeAttr('disabled');
		$('#CoffeeShopExportSearchForm_ownerEmail').removeAttr('disabled');
	}
	else{
		$('#CoffeeShopExportSearchForm_ownerName').attr('disabled','disabled');
		$('#CoffeeShopExportSearchForm_ownerEmail').attr('disabled','disabled');
	}
});

$('#CoffeeShopExportSearchForm_subscribed').click(function(){
	if($(this).attr('checked')=='checked'){
		$('#paymentDateStartSelect').removeAttr('disabled');
		$('#paymentDateEndSelect').removeAttr('disabled');
	}
	else{
		$('#paymentDateStartSelect').attr('disabled','disabled');
		$('#paymentDateEndSelect').attr('disabled','disabled');
	}
});

");
*/
?>

<h1>Export Coffee Shop</h1>

<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'coffeeshop-export-search-form',
	'enableAjaxValidation'=>false,
)); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'coffeeShopName'); ?>
		<?php echo $form->textField($model,'coffeeShopName',array('size'=>60,'maxlength'=>64)); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model, 'suburb')?>
		<?php echo $form->textField($model,'suburb',array('size'=>60,'maxlength'=>64)); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model, 'state')?>
		<?php echo $form->textField($model,'state',array('size'=>60,'maxlength'=>64)); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'claimed'); ?>
		<?php //echo $form->checkBox($model,'claimed'); ?>
		<?php echo $form->DropDownList($model, 'claimed', DataUtil::option_yes_no_empty());?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ownerName'); ?>
		<?php echo $form->textField($model,'ownerName',array('size'=>60,'maxlength'=>64)); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ownerEmail'); ?>
		<?php echo $form->textField($model,'ownerEmail',array('size'=>60,'maxlength'=>64)); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'subscribed'); ?>
		<?php //echo $form->checkBox($model,'subscribed'); ?>
		<?php echo $form->dropDownList($model,'subscribed',DataUtil::option_yes_no_empty());?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'paymentDateStart'); ?>
		From 
		<?php echo $form->hiddenField($model,'paymentDateStart'); ?>
		<?php 
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    'name'=>'paymentDateStartSelect',
		    'options'=>array(
				'altField'=>'#'.CHtml::activeId($model, "paymentDateStart"),				
		    ),
			'htmlOptions'=>array(
		        'readonly'=>'readonly',
		    ),		   
		));
		?>
		To 
		<?php echo $form->hiddenField($model,'paymentDateEnd'); ?>
		<?php 
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    'name'=>'paymentDateEndSelect',
		    'options'=>array(
				'altField'=>'#'.CHtml::activeId($model, "paymentDateEnd"),				
		    ),
			'htmlOptions'=>array(
		        'readonly'=>'readonly',
		    ),
		));
		?> 
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'votePeriod'); ?>
		<?php echo $form->dropDownList($model,'votePeriod',CafeVote::getPeriodArray(),array('empty'=>'')); ?>
	</div>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton('Export'); ?>
	</div>

<?php $this->endWidget(); ?><!-- End of Form -->
</div>